<?php

namespace app\controller;

use SinglePHP\BaseController;
use SinglePHP\Cache;
use SinglePHP\Config;
use SinglePHP\Hook;
use SinglePHP\Log;
use SinglePHP\Plugin;
use SinglePHP\Request;
use SinglePHP\View;


class Index extends BaseController
{
    public function Index()
    {
        View::assign('title', "这是SinglePHP");
        View::assign('Hook', Hook::event('table_name'));
        // return View::api();
        dump(Hook::event('table_name'));
        Log::notice('in plugins');
        View::display();
    }
    public function test()
    {
        Cache::set('Controller', 'Index');
        dump('www');
        dump(Request::isAjax());
        dump(Cache::get('Controller'));
        Log::notice('in plugins');
        dump(Config::get('LOG_LEVEL'));
        dump(Config::set('Controller', 'Index'));
        dump(Config::all());
        Plugin::trigger('demo');
    }
}
